<template>
  <el-container>
    <el-aside>
      <s-menu></s-menu>
    </el-aside>
    <el-container>
      <el-header class="header-breadcrumb flex-between">
        <el-breadcrumb separator="/">
          <span v-show="currentMenu.length === 0">首页</span>
          <el-breadcrumb-item v-show="currentMenu.length > 0" :to="{ path: '/' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item v-for="(item, index) in currentMenu" :key="index" :to="item.path">{{ item.meta.title }}</el-breadcrumb-item>
        </el-breadcrumb>
        <!--<div>-->
          <!--<el-dropdown>-->
            <!--<span class="el-dropdown-link flex-start">-->
              <!--<img style="width: 30px;height: 30px;border-radius: 50%" src="../../assets/logo.png" alt="">-->
              <!--<i class="el-icon-caret-bottom el-icon-caret-top"></i>-->
            <!--</span>-->
            <!--<el-dropdown-menu slot="dropdown">-->
              <!--<el-dropdown-item @click.native="logout">退出</el-dropdown-item>-->
            <!--</el-dropdown-menu>-->
          <!--</el-dropdown>-->
        <!--</div>-->
      </el-header>
      <el-main>
        <transition name="fade-transform" mode="out-in">
          <router-view></router-view>
        </transition>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import sMenu from '../menu'
import menuList from '../../router/routes'
export default {
  components: {
    sMenu
  },
  computed: {
    currentMenu () {
      return this.$store.getters.currentMenu
    }
  },
  mounted () {
    this.$store.commit('SET_MENU', menuList)
  },
  methods: {
    logout () {
      this.$store.commit('RESET_STATE')
    }
  }
}
</script>

<style lang="less" scoped>
  @import "Index";
</style>
